package com.jack.payment.annotation;

import com.jack.payment.util.serializer.BigDecimalVaildator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.math.BigDecimal;


@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = BigDecimalVaildator.class)
public @interface BigDecimalRange {
    String message() default  "Value must be between {min} and {max} (inclusive)";
    Class<?>[] groups() default  {};
    Class<? extends Payload>[] payload() default {};
    String min() default "1";
    String max() default "10000";
}
